package com.testmanager.testmananger.quantitative.repository;

import com.testmanager.testmananger.quantitative.domain.WorkerEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface WorkerRepository extends JpaRepository<WorkerEntity,Long> {

   /* @Query(value = "select * from yx_worker where user_sign=?1",nativeQuery = true)
    List<WorkerEntity> findByUserSign(Long userSignId);*/
    List<WorkerEntity> findWorkerEntitiesByOwnerNo(Long ownerno);
    List<WorkerEntity> findWorkerEntitiesByOwnerNoOrderByIdDesc(Long ownerno);
    WorkerEntity findWorkerEntityByOwnerNo(Long ownerno);
    @Modifying
    Integer deleteByOwnerNo(long id);
   // List<WorkerEntity> findWorkerEntitiesByOwnerNoAnd
   // WorkerEntity findWorkerEntityByOwnerNo(long ownerno);
}
